package com.lx.oms.controller.service.impl;

import java.math.BigInteger;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lx.oms.common.entity.Page;
import com.lx.oms.common.entity.Query;
import com.lx.oms.common.entity.R;
import com.lx.oms.common.utils.CommonUtils;
import com.lx.oms.controller.entity.QuotationAnalysisEntity;
import com.lx.oms.controller.manager.QuotationAnalysisManager;
import com.lx.oms.controller.service.QuotationAnalysisService;

/**
 * 行情分析
 *
 * @author houzhong
 * @date 2018年7月19日 上午11:16:01
 */
@Service("quotationAnalysisService")
public class QuotationAnalysisServiceImpl implements QuotationAnalysisService {

	@Autowired
	private QuotationAnalysisManager quotationAnalysisManager;

	@Override
	public Page<QuotationAnalysisEntity> listQuotationAnalysis(Map<String, Object> params) {
		Query query = new Query(params);
		Page<QuotationAnalysisEntity> page = new Page<>(query);
		quotationAnalysisManager.listQuotationAnalysis(page, query);
		return page;
	}

	@Override
	public R saveQuotationAnalysis(QuotationAnalysisEntity role) {
		int count = quotationAnalysisManager.saveQuotationAnalysis(role);
		return CommonUtils.msg(count);
	}

	@Override
	public R getQuotationAnalysisById(BigInteger id) {
		QuotationAnalysisEntity quotationAnalysis = quotationAnalysisManager.getQuotationAnalysisById(id);
		return CommonUtils.msg(quotationAnalysis);
	}

	@Override
	public R updateQuotationAnalysis(QuotationAnalysisEntity quotationAnalysis) {
		int count = quotationAnalysisManager.updateQuotationAnalysis(quotationAnalysis);
		return CommonUtils.msg(count);
	}

	@Override
	public R batchRemove(String[] id) {
		int count = quotationAnalysisManager.batchRemove(id);
		return CommonUtils.msg(id, count);
	}

}
